import swaggerJsdoc from 'swagger-jsdoc'

const options = {
  definition: {
    openapi: '3.0.0',
    info: {
      title: '用户管理系统 API',
      version: '1.0.0',
      description: 'API 文档',
    },
    servers: [
      {
        url: process.env.NODE_ENV === 'production' 
          ? 'https://your-domain.com' 
          : 'http://localhost:3000',
      },
    ],
  },
  apis: ['./app/api/**/*.ts'], // API 路由文件的路径
}

export const spec = swaggerJsdoc(options) 